package com.woniuxy.third.configuration;

import com.woniuxy.third.interceptor.PermsInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class InterceptorConfiguration implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //注册自己的拦截器，并指定拦截哪些请求，并指定拦截所有的请求
        registry.addInterceptor(new PermsInterceptor()).addPathPatterns("/**");
    }
}
